'use strict';
const Koa = require('koa');
const cors = require('koa-cors');
const bodyParser = require('koa-bodyparser');
const router = require('koa-router');
const Sequelize = require('sequelize');
let app = new Koa();
let sequelize = new Sequelize('soft1','post1','xuzirong0.0',{
    host:'host.xuzirong.top',
    dialect: 'post1'
})
const product = require('./model/product');
let Products = sequelize.define('products',product);
sequelize.sync({force:true}).then(()=>{
    Products.bulkCreate([
        {
              
            
        }
    ])
})

router.get('/product',(ctx,next)=>{
    ctx.body=[
        {

        },
    ]
})
router.post('/product',(ctx,next)=>{
    
})
router.put('/product',(ctx,next)=>{
    
})
router.delete('/product',(ctx,next)=>{
    
})

app.use(router.routes());
let port=3000;
app.listen(port);
console.log(`服务器运行在这个地址：http://localhost:${port}`);